home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / glibmm-2.4 / proc / m4 / method.m4 < prev    next >
M4 Source File  |  2006-04-20  |  2KB  |  59 lines

  1. dnl $Id: method.m4,v 1.2 2003/01/27 23:18:25 murrayc Exp $
  2.  
  3. dnl
  4. dnl
  5. dnl  Code generation sections for making a method.  
  6. dnl
  7. dnl
  8.  
  9.  
  10. dnl
  11. dnl method 
  12. dnl            $1      $2     $3         $4       $5    $6    $7     $8        $9
  13. dnl  _METHOD(cppname,cname,cpprettype,crettype,arglist,cargs,const,refreturn,errthrow)
  14. define(`_METHOD',`dnl
  15. _PUSH(SECTION_CC)
  16. $3 __CPPNAME__::$1`'($5)ifelse(`$7',1,` const')
  17. {
  18. ifelse(`$8'`$9',,dnl
  19. `  ifelse(`$3',void,,`return ')_CONVERT($4,$3,`$2`'(ifelse(`$7',1,const_cast<__CNAME__*>(gobj()),gobj())`'ifelse(`$6',,,`, ')$6)');
  20. ', dnl
  21. `ifelse(`$9',,,`  GError *error = 0;')
  22.   ifelse(`$3',void,,``$3' retvalue = ')_CONVERT($4,$3,`$2`'(ifelse(`$7',1,const_cast<__CNAME__*>(gobj()),gobj())`'ifelse(`$6',,,`, ')$6)');
  23. ifelse(`$9',,,`  if(error) ::Glib::Error::throw_exception(error);')
  24. ifelse(`$8',,,`dnl
  25.   if(retvalue)
  26.     retvalue->reference(); //The function does not do a ref for us.
  27. ')dnl
  28. ifelse(`$3',void,,`  return retvalue;')
  29. ')dnl
  30. }
  31.  
  32. _POP()')
  33.  
  34. dnl
  35. dnl static method
  36. dnl                  $1       $2     $3         $4      $5     $6      $7      $8
  37. dnl  _STATIC_METHOD(cppname,cname,cpprettype,crettype,arglist,cargs,refreturn,errthrow))
  38. define(`_STATIC_METHOD',`dnl
  39. _PUSH(SECTION_CC)
  40. $3 __CPPNAME__::$1($5)
  41. {
  42. ifelse(`$7'`$8',,dnl
  43. `  ifelse(`$3',void,,`return ')_CONVERT($4,$3,`$2`'($6)');
  44. ', dnl
  45. `ifelse(`$8',,,`  GError *error = 0;')
  46.   ifelse(`$3',void,,``$3' retvalue = ')_CONVERT($4,$3,`$2`'($6)');
  47. ifelse(`$8',,,`  if(error) ::Glib::Error::throw_exception(error);')
  48. ifelse(`$7',,,`dnl
  49.   if(retvalue)
  50.     retvalue->reference(); //The function does not do a ref for us.
  51. ')dnl
  52. ifelse(`$3',void,,`  return retvalue;')
  53. ')dnl
  54. }
  55.  
  56. _POP()')
  57.  
  58.  
  59.